<?php 
class notice extends Controller {

var $event 				= '';
var	$obj_news			= '';
var $m_nid				= '';
var $m_language			= 'eng';
/* Paging*/
var $ctr_name			= '';
var	$ncurrent_page		= 1;
var	$nrow_per_page		= 5;
var $ntotal_row			= 0;
/* Paging*/
var $nid_section		= '';
var $nid_cat			= '';
var $img_cpt			= '';

var	$title					= '';
var	$tags					= '';
var	$description			= ''; 

var $txt_name			= '';
var	$txt_title			= '';
var $txt_content		= '';

var $tag_detail			= '';
var $title_detail		= '';
var $short_detail		= '';
var $obj_data			= '';

function notice()
	{
		parent::Controller();	
		session_start();
		
		$this->load->database();	
		$this->load->helper('ap_function');
		$this->load->helper('ap_object');
		$this->load->helper('ap_html');
		$this->load->helper('ap_view_helper');
		$this->load->helper('ap_db');
		$this->load->helper('ap_module');
		$this->load->language('ap', 'eng');
		
		//$this->load->model('fr_news_model');
	}

// Dinh nghia ham rut gon khi set language cho cac label.
// 
private function m_language_key($str_key)
{
	return $this->lang->line('lbl.news.'.$str_key);
}

function detail($nid)
{
	
	//update hit for article

	$this->db->where('nid', $nid);
	$obj_temp = $this->db->get('tarticle');
	$this->obj_data = $obj_temp->row_array();
	$this->m_nid = $nid;
	$this->event = 'detail';
	$this->do_process();
}

function page($current_page)
{	
	$this->ncurrent_page			= $current_page;
	$this->do_process();
}

function index()
{
	$this->do_process();
}



function do_process() 
{
	$this->get_data(); 		
	$this->caculate_data(); 		
	$this->do_business(); 		
	$this->destroy_data();
}
	
private function get_data()
{  
	
}
	
private function caculate_data()
{
	$this->load->language('ap', $this->m_language);
	
 	$this->event			= $this->event == ''?'view':$this->event;
	
}

private function do_business()
{	
	
	$data['obj_data']	= $this->obj_data;
	$data['lbl_tinmoi']	= $this->m_language_key('tinmoi');
	$data['lbl_tin']	= $this->m_language_key('tin');
	$data['link_page']	= base_url().'index.php/news';
	$data['event']		= $this->event;
	$data['m_nid']		= $this->m_nid;
	$data['nid_cat']	= $this->nid_cat;
	$data['nid_sec']	= $this->nid_section;
	$data['menu_sec']		= '';
	$data['menu_cat']		= '';
	$data['g_ishome']		= 0;
	$this->load->view('notice',$data);	
	
}
	
private function destroy_data()
{
			
}
private function get_where_news_string()
{
//		$str		= 'where nstatus = "1"';	
		//$str	   = 'where ccode_cat_news = "'.$this->m_nid_cat_news.'" ';
		//if($this->m_nid !='')
		//	$str	   .= 'AND nid = "'.$this->m_nid.'" ';
//Dieu kien get record nstatus
//0:Khong active
//1:Active

		//return $str ;
}

}